var markDown;
$(function() {
	markDown = editormd("editormd", {
		width              : "99%",
		//autoHeight         : true,
		height             : 700,
		path               : "editormd/lib/",
		syncScrolling      : true,				//true(默认)：双向，"single"：单向，false：禁用同步滚动
		htmlDecode         : "style,script,iframe", 
		//htmlDecode       : true,								 // Decode all html tags & attributes
																// Filter tags/attributes expression : tagName,tagName,...|attrName,attrName,...
		//htmlDecode       : "style,script,iframe,sub,sup|on*",  // Filter tags, and all on* attributes
		//htmlDecode       : "style,script,iframe,sub,sup|*",    // Filter tags, and all attributes
		//htmlDecode       : "style,script,iframe,sub,sup,embed|onclick,title,onmouseover,onmouseout,style", // Filter tags, and your custom attributes
		emoji              : true,
		//pageBreak          : false;				//分页符
		taskList           : true, 
		tex                : true,				// 开启科学公式TeX语言支持，默认关闭  file://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css
		flowChart          : true,				// 开启流程图支持，默认关闭
		sequenceDiagram    : true,				// 开启时序/序列图支持，默认关闭
		// watch              : true,				// true（默认值）:开启实时预览，false:关闭实时预览
		//saveHTMLToTextarea : true,				//注意3：这个配置，方便post提交表单
		disabledKeyMaps : [
			"Ctrl-B", "F11", "F10"  // disable some default keyboard shortcuts handle
		],
		onchange : function() {
			markDownVue.listenChange();
		},
		onload : function() {
			var keyMap = {
				"Ctrl-S": function(cm) {markDownVue.saveMarkDown();},
				"Ctrl-A": function(cm) {cm.execCommand("selectAll");}
			};
			this.addKeyMap(keyMap);
			window.markDown.setMarkdown(window.markDownVue.curMarkDown["data"]);
		}
	});
	markDown.katexURL = {
		js  : "KaTeX/katex.min",
		css : "KaTeX/katex.min"
	};
});